{% if messages %}
<div class="container">
  <div class="row">
   {% for message in messages %}
     <div class="
       {% if 'nofadeout' in message.tags %}
         {# Don't dissappear after some number of seconds #}
         nofadeout
       {% endif %}
       alert
       {% if 'warning' in message.tags %}
         alert-danger
       {% elif 'success' in message.tags %}
         alert-success
       {% else %}
         alert-info
       {% endif %}
     ">
       {# http://stackoverflow.com/a/10124845 #}
       {% if 'safe' in message.tags %}
         {{ message|safe }}
       {% else %}
         {{ message }}
       {% endif %}
       <button type="button" class="close" data-dismiss="alert">×</button>
     </div>
   {% endfor %}
  </div>
</div>
{% endif %}
